//package com.think.archive.controller.api;
//
//import com.alibaba.fastjson.JSONObject;
//import com.think.archive.common.ResultBean;
//import com.think.archive.dto.SysRoleDto;
//import com.think.archive.dto.SysUserDto;
//import com.think.archive.model.*;
//import com.think.archive.service.*;
//import com.think.archive.util.OrikaUtil;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
//@RestController
//@RequestMapping("api")
//public class ApiController {
//
//    @Autowired
//    SysUserService userService;
//
//    @Autowired
//    SysRoleService roleService;
//
//    @Autowired
//    SysDeptService deptService;
//
//    @Autowired
//    InfoFileService fileService;
//
//    @Autowired
//    InfoArchiveService archiveService;
//
//    @Autowired
//    SysFuncService funcService;
//
//    @GetMapping("files")
//    public ResultBean getFiles(){
//        List<InfoFile> files=fileService.selectAllFile();
//        return ResultBean.createResultBySuccess(files);
//    }
//
//    @GetMapping(value = {"funcs/{code}","funcs"})
//    public ResultBean getFuncsByCode(@PathVariable(value = "code",required = false) String code){
//        List<SysFunc> funcs=funcService.selectListByCode((code==null?"":code));
//        return ResultBean.createResultBySuccess(funcs);
//    }
//
//    @PostMapping("saveFunc")
//    public ResultBean savepPrmission(SysFunc func){
//        return ResultBean.createResultBySuccess(funcService.insertOrUpdateFunc(func));
//    }
//
//    @PostMapping("deletePrmission")
//    public ResultBean deletePrmission(int id){
//        return ResultBean.createResultBySuccess(funcService.deleteFunc(id));
//    }
//
//    @GetMapping("archive/{archiveId}")
//    public ResultBean archive(@PathVariable("archiveId") String archiveId){
//        JSONObject archive=archiveService.getArchiveById(archiveId);
//        if(archive==null){
//            return ResultBean.createResultByError("暂无数据");
//        }else{
//            return ResultBean.createResultBySuccess(archive);
//        }
//    }
//
//
//
//}
